home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / Commodities / BlocNotes / scroller.rexx < prev    next >
OS/2 REXX Batch file  |  1996-09-26  |  2KB  |  82 lines

  1. /*Scroller.rexx v3.7*/
  2. IF POS('blocnotes.rexx' , SHOW('Ports'))=0 THEN do
  3.    say "Sorry, I need Blocnotes. Run it first"
  4.    exit
  5. end
  6.  
  7. address 'blocnotes.rexx'
  8. options results
  9.  
  10. /******************************************************************
  11.  Adjust these variables to fit in your system.
  12. ******************************************************************/
  13.  
  14. FName="LetterGothic.font"          /*Font to use*/
  15. FSize=60                           /*Size of the font*/
  16. /*****************************************************************/
  17.  
  18.  
  19. GETSCREENDATA
  20. parse VAR result . . ScrW ScrH .
  21.  
  22. WW=FSize*5
  23. WH=FSize+7
  24. Speed=3
  25.  
  26. forever=0
  27.  
  28. if words(Arg(1))<2 then do
  29.    if Arg(1)='?' then do
  30.       say 'USAGE: rx Scroller <times> <string>'
  31.       say 'Maximum length is 70 chars.'
  32.    end
  33.    times=3
  34.    string='USAGE: rx Scroller.rexx <times> <string>.Press a key.'
  35. end
  36. else do
  37.    times=word(arg(1),1)
  38.    if times=0 then forever=1
  39.    if (times=0)|(times>40) then times=2
  40.  
  41.    p=POS(' ',Arg(1))
  42.    string=RIGHT(Arg(1),LENGTH(Arg(1))-p)
  43.    if LENGTH(string)>70 then do
  44.       string=left(string,70);
  45.    end
  46. end
  47.  
  48. OPEN TRUNC(ScrW-WW)/2 TRUNC((ScrH-WH)/3) WW WH FONTNAME FName FONTSIZE FSize NOSAVE NOGADGET NOEDIT NOSCROLLER SCREEN 'Workbench'
  49. id=result
  50.  
  51. if id=0 then do
  52.    say 'Can''t open window.'
  53.    exit
  54. end
  55.  
  56. SETINSTIME Speed
  57. WORDWRAP id OFF
  58. INHIBIT id ON
  59. ONCLICK EXIT
  60. AA=0
  61.  
  62. do i=0 to times-1
  63.    CLEAR id
  64.    GO id 1 0
  65.    GO id 10 0
  66.    PRINT id "        "
  67.    if AA=0 then do
  68.       SHOW id
  69.       AA=1
  70.    end
  71.    WASCLICKED id
  72.    if result='1' then break
  73.    PRINT id string
  74.    WASCLICKED id
  75.    if result='1' then break
  76.    PRINT id "          "
  77.    WASCLICKED id
  78.    if result='1' then break
  79.    if forever=1 then i=0
  80. end
  81. CLOSE id
  82.